//
//  Stock_VC.h
//  KaChing_App
//
//  Created by Jordan Robert Yust on 4/8/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataManager.h"
#import "Trade_VC.h"

@interface Stock_VC : UIViewController <UISearchBarDelegate, UITableViewDataSource, UITableViewDelegate>
{
	DataManager *dataManager;			// DataManager object (universally distributed throughout app)
	NSNumberFormatter *numberFormatter;	// Formatter used in formatting cash, stock prices, etc.
	NSDateFormatter *timeStampInputFormatter;	//used in formatting the stockWall's time stamp
	NSDateFormatter *timeStampOutputFormatter;	//used in formatting the stockWall's time stamp
	Trade_VC *trade_VC;					// The Trade_VC object
	NSDictionary *stockWall;				// The stock's Wall
	
	NSNumber *stockPrice_number;	// The stock's price as an NSNumber
	NSNumber *priceChange_number;	// The stock's price's daily change as an NSNumber
	
	UIAlertView *add2Watchlist_AlertView;	// The AlertView verifying user wants to add the stock to the watchlist
	
	/* IBOutlets */
	IBOutlet UISearchBar *tickerSearchBar;	// The searchBar to search for stocks
	IBOutlet UILabel *stockName_Label;		// The label that holds the stock's name
	IBOutlet UILabel *price_Label;			// The label that holds the stock's price
	IBOutlet UILabel *dailyChange_Label;	// The label that holds the stock's price's daily change
	
	IBOutlet UITableView *wallTableView;	// The tableView that displays the stock's wall
	
	IBOutlet UIButton *tradeButton;			// The button that transitions to the trading screen
	IBOutlet UIButton *watchlistButton;		// The button that adds the stock to the watchlist
	
	
}

/* PROPERTIES */
@property(nonatomic, retain) DataManager *dataManager;
@property(nonatomic, retain) NSNumberFormatter *numberFormatter;
@property(nonatomic, retain) NSDateFormatter *timeStampInputFormatter;
@property(nonatomic, retain) NSDateFormatter *timeStampOutputFormatter;
@property(nonatomic, retain) Trade_VC *trade_VC;
@property(nonatomic, retain) NSDictionary *stockWall;

@property(nonatomic, retain) NSNumber *stockPrice_number;
@property(nonatomic, retain) NSNumber *priceChange_number;

@property(nonatomic, retain) UIAlertView *add2Watchlist_AlertView;

@property(nonatomic, retain) UISearchBar *tickerSearchBar;
@property(nonatomic, retain) UILabel *stockName_Label;
@property(nonatomic, retain) UILabel *price_Label;
@property(nonatomic, retain) UILabel *dailyChange_Label;
@property(nonatomic, retain) UITableView *wallTableView;
@property(nonatomic, retain) UIButton *tradeButton;
@property(nonatomic, retain) UIButton *watchlistButton;


/* METHODS */
- (void) createFormatters;

- (IBAction) refreshStockPrice;
- (IBAction) tradeStock;
- (IBAction) add_2_WatchList;

@end;